package com.lagou.service.impl;

import com.lagou.dao.ResumeDao;
import com.lagou.pojo.Resume;
import com.lagou.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

@Service
public class ResumeServiceImpl implements ResumeService {

    @Autowired
    private ResumeDao resumeDao;

    @Override
    public Resume findResumeByUserId(Long id) {
        Resume resumeExample = new Resume();
        resumeExample.setUserId(id);
        resumeExample.setIsDefault(1);
        Example example = Example.of(resumeExample);
        Resume resume = (Resume) resumeDao.findOne(example).get();
        return resume;
    }

}
